#include <iostream>
#include <unordered_map>

using namespace std;

int main()
{
    unordered_map<string,int> mp;
    int q; cin >> q;
    while(q--)
    {
        int op,score;
        string name;
        cin >> op;
        if(op == 1)
        {
            cin >> name;
            cin >> score;
            mp[name] = score;
            cout << "OK" << endl;
        }else if (op == 2)
        {
            cin >> name;
            if(mp.count(name)) cout << mp[name] << endl;
            else cout << "Not found" << endl;
        }
        else if(op == 3)
        {
            cin >> name;
            if(mp.count(name)) 
            {
                mp.erase(name);
                cout << "Deleted successfully" << endl;
            }
            else{
                cout << "Not found" << endl;
            }
        }else{
            cout << mp.size() << endl;
        }
    }

    return 0;
}